<html><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>GradientColor</title></head>
<body bgcolor="#FFFFDF" link="#009999" vlink="#006666" alink="#006666">
<font face="Arial" size="2"><p align="center"><b><font size="4">GradientColor()</font></b></p>
<p><b>Syntax</b></p><blockquote>
<font color="#006666"><b>GradientColor</b></font>(Position.f, Color)</blockquote>

</blockquote>
<b>Description</b><br><blockquote>



Adds the given Color at the given Position to the spectrum of the drawing gradient. 

 

</blockquote><p><b>Parameters</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>Position.f</i></td>
<td width="90%"> 
 
The position for the color in the gradient. 
It must be a float value between 0.0 and 1.0. 

 

</td></tr>
<tr><td><i>Color</i></td>
<td> 
 
The color to be used. 
This color can be in <a href="../2ddrawing/rgb.html">RGB</a> or <a href="../2ddrawing/rgba.html">RGBA</a> format. 

 

</td></tr>
</table>
</blockquote><p><b>Return value</b></p><blockquote>

None.





</blockquote><p><b>Remarks</b></p><blockquote>



By default, the drawing gradient ranges from the current <a href="backcolor.html">background color</a> at position 
0.0 to the current <a href="frontcolor.html">front color</a> at position 1.0. With this command, additional colors 
can be added Inbetween, or the colors at 0.0 and 1.0 can be overwritten. 
<br>
<br>
The <a href="resetgradientcolors.html">ResetGradientColors()</a> command can be used to revert back to the default gradient. 
<br>
<br>
The following commands can be used to specify the shape of the drawing gradient: 
<br>
- <a href="lineargradient.html">LinearGradient()</a> 
<br>
- <a href="circulargradient.html">CircularGradient()</a> 
<br>
- <a href="ellipticalgradient.html">EllipticalGradient()</a> 
<br>
- <a href="boxedgradient.html">BoxedGradient()</a> 
<br>
- <a href="conicalgradient.html">ConicalGradient()</a> 
<br>
- <a href="customgradient.html">CustomGradient()</a> 
<br>
<br>
Note: This command only has an effect with <a href="../image/imageoutput.html">ImageOutput()</a> and <a href="../gadget/canvasoutput.html">CanvasOutput()</a>. 
The gradient only affects the drawing commands when <font color="#924B72">#PB_2DDrawing_Gradient</font> is 
set with the <a href="drawingmode.html">DrawingMode()</a> command. 

 

</blockquote><p><b>Example</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2">  <b><font color="#006666">If</font></b> <font color="#006666">OpenWindow</font>(0, 0, 0, 400, 200, "2DDrawing Example", <font color="#924B72">#PB_Window_SystemMenu</font> | <font color="#924B72">#PB_Window_ScreenCentered</font>)
    <b><font color="#006666">If</font></b> <font color="#006666">CreateImage</font>(0, 400, 200) <b><font color="#006666">And</font></b> <font color="#006666">StartDrawing</font>(<font color="#006666">ImageOutput</font>(0))
<font color="#006666">      Box</font>(0, 0, 400, 200, $FFFFFF)
      
<font color="#006666">      DrawingMode</font>(<font color="#924B72">#PB_2DDrawing_Gradient</font>)      
<font color="#006666">      BackColor</font>($0000FF)
<font color="#006666">      GradientColor</font>(0.4, $00FFFF)
<font color="#006666">      GradientColor</font>(0.6, $FFFF00)
<font color="#006666">      FrontColor</font>($FF0000)
      
<font color="#006666">      LinearGradient</font>(0, 0, 200, 200)    
<font color="#006666">      Circle</font>(100, 100, 100)   
<font color="#006666">      LinearGradient</font>(350, 100, 250, 100)
<font color="#006666">      Circle</font>(300, 100, 100)
      
<font color="#006666">      StopDrawing</font>() 
<font color="#006666">      ImageGadget</font>(0, 0, 0, 400, 200,<font color="#006666"> ImageID</font>(0))
    <b><font color="#006666">EndIf</font></b>
    
    <b><font color="#006666">Repeat</font></b>
      Event =<font color="#006666"> WaitWindowEvent</font>()
    <b><font color="#006666">Until</font></b> Event = <font color="#924B72">#PB_Event_CloseWindow</font>
  <b><font color="#006666">EndIf</font></b>
</font></pre>

<br>
<p><img src="../HelpPictures/gradientcolor.png"></p>

</blockquote><p><b>See Also</b></p><blockquote>

<a href="resetgradientcolors.html">ResetGradientColors()</a>, 
<a href="lineargradient.html">LinearGradient()</a>, <a href="circulargradient.html">CircularGradient()</a>, <a href="ellipticalgradient.html">EllipticalGradient()</a>, 
<a href="boxedgradient.html">BoxedGradient()</a>, <a href="conicalgradient.html">ConicalGradient()</a>, <a href="customgradient.html">CustomGradient()</a>, 
<a href="drawingmode.html">DrawingMode()</a> 

</Blockquote><p><b>Supported OS  </b><Blockquote>All</Blockquote></p><center>&lt;- <a href=grabdrawingimage.html>GrabDrawingImage()</a> - <a href=index.html>2DDrawing Index</a> - <a href=green.html>Green()</a> -&gt;



</body></html>